package gdma.hqdes.service;

import com.google.common.collect.BiMap;
import gdma.hqdes.bean.HqdIndex;
import gdma.hqdes.bean.HqdIndexVer;
import gdma.hqdes.bean.StatIndex;
import gdma.hqdes.bean.StatIndexItem;

import javax.annotation.Nullable;
import java.util.Collection;
import java.util.List;
import java.util.Map;

public interface IndexService {

    HqdIndex getIndex(long id);

    List<HqdIndex> getThinIndexes(Long... ids);

    List<HqdIndex> listThinIndexes(@Nullable Collection<Integer> verIds, @Nullable Collection<String> codes, @Nullable String keyword);

    HqdIndex buildThinIndexTree(long verId);

    HqdIndex buildIndexTree(long verId);

    HqdIndex buildScoredIndexTree(long projectId, long unitId);

    HqdIndex saveIndex(HqdIndex hqdIndex);

    void cloneIndex(Integer copyFromVerId, int newVerId);

    int deleteIndex(long indexId);

    int deleteIndexExt(long id);

    int deleteIndexArg(long id);

    HqdIndexVer getIndexVersion(int id);

    List<HqdIndexVer> listIndexVersions(@Nullable String name, @Nullable Integer scope0);

    HqdIndexVer saveIndexVersion(HqdIndexVer hqdIndexVer);

    Map<Integer, BiMap<String, Long>> getVerIdCodeIndexIdMapping(Collection<Integer> verIds);

    StatIndex getStatIndex(Long statIndexId);

    List<StatIndexItem> getStatIndexItems(Long statIndexId);

    List<StatIndex> getStatIndexes(int verId);

    List<StatIndex> listStatIndexes(@Nullable Collection<Integer> verIds, @Nullable Collection<String> codes, @Nullable String name);

    StatIndex saveStatIndex(StatIndex statIndex);

    void cloneStatIndexes(Integer copyFromVerId, int verId);

    int deleteStatIndex(long id);

    int deleteStatIndexItem(long id);

}
